import java.util.Arrays;

/**
 * Created by Salted fish
 * Description:
 * User: 24539
 * Date：2021-08-03
 * Time: 16:52
 */
public class Test1 {
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5,6,7};
        fund(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void fund(int[] arr) {
        int left = 0;
        int right = arr.length-1;
        while (left<right) {
            while (left < right && arr[left]%2==0) {
                left++;
            }while (left<right && arr[right]%2!=0) {
                right--;
            }
            int tmp=arr[left];
            arr[left]=arr[right];
            arr[right]=tmp;
        }
    }
    }


